<?php

declare(strict_types=1);

namespace DreamCat\StateMachine\Popo\Define;

/**
 * 状态机动作详情
 * @author vijay
 */
class MachineActionDetail
{
    /** @var string 动作标识 */
    private string $key;
    /** @var string 动作名称 */
    private string $name;
    /** @var string|null 前置条件检查类 */
    private ?string $precondition = null;
    /** @var string|null 状态查询类 */
    private ?string $statusQuery = null;
    /** @var string|null 后置条件检查类 */
    private ?string $execCondition = null;
    /** @var string[] 可操作人员列表 */
    private array $operatorList = [];

    /**
     * @return string[] 可操作人员列表
     */
    public function getOperatorList(): array
    {
        return $this->operatorList;
    }

    /**
     * @param string[] $operatorList 可操作人员列表
     * @return MachineActionDetail
     */
    public function setOperatorList(array $operatorList): MachineActionDetail
    {
        $this->operatorList = $operatorList;
        return $this;
    }

    /**
     * @return string 动作标识
     */
    public function getKey(): string
    {
        return $this->key;
    }

    /**
     * @param string $key 动作标识
     * @return MachineActionDetail
     */
    public function setKey(string $key): MachineActionDetail
    {
        $this->key = $key;
        return $this;
    }

    /**
     * @return string 动作名称
     */
    public function getName(): string
    {
        return $this->name;
    }

    /**
     * @param string $name 动作名称
     * @return MachineActionDetail
     */
    public function setName(string $name): MachineActionDetail
    {
        $this->name = $name;
        return $this;
    }

    /**
     * @return string|null 前置条件检查类
     */
    public function getPrecondition(): ?string
    {
        return $this->precondition;
    }

    /**
     * @param string|null $precondition 前置条件检查类
     * @return MachineActionDetail
     */
    public function setPrecondition(?string $precondition): MachineActionDetail
    {
        $this->precondition = $precondition;
        return $this;
    }

    /**
     * @return string|null 状态查询类
     */
    public function getStatusQuery(): ?string
    {
        return $this->statusQuery;
    }

    /**
     * @param string|null $statusQuery 状态查询类
     * @return MachineActionDetail
     */
    public function setStatusQuery(?string $statusQuery): MachineActionDetail
    {
        $this->statusQuery = $statusQuery;
        return $this;
    }

    /**
     * @return string|null 后置条件检查类
     */
    public function getExecCondition(): ?string
    {
        return $this->execCondition;
    }

    /**
     * @param string|null $execCondition 后置条件检查类
     * @return MachineActionDetail
     */
    public function setExecCondition(?string $execCondition): MachineActionDetail
    {
        $this->execCondition = $execCondition;
        return $this;
    }
}

# end of file
